#include <stdio.h>
#include <math.h>
main()
{  	 	 
    int n = 1,count = 1;
    double e = 1.0, term = 1.0;
    long fac = 1;
    printf("e = %.8f, count = %d\n", e, count); //1
    for(n = 1; fabs(term) >= 1e-7; n++)  //2
    {  	 	 
        fac = fac * n; //1
        term = 1.0 / fac; //1
        e = e + term;  //2
        count++;  //1
        printf("e = %.8f, count = %d\n", e, count); //2
    }
}